var t,
  a = (t = require("../config/page")) && t.__esModule ? t : { default: t };
var n = null;
Component({
  data: {
    selected: -1,
    isWhite: !1,
    color: "#E7C78C",
    selectedColor: "#E7C78C",
    list: [
      {
        pagePath: a.default.PAGE_INDEX,
        selectImg:
          "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/5.png",
        img: "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/1.png",
        white_img:
          "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/9.png",
        gif: "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/new/tab1.png",
        text: "推荐",
      },
      {
        pagePath: a.default.PAGE_TOUR_INDEX,
        selectImg:
          "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/6.png",
        img: "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/2.png",
        white_img:
          "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/10.png",
        gif: "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/new/tab2.png",
        text: "游览",
      },
      {
        pagePath: a.default.PAGE_APPRECIATION_INDEX,
        selectImg:
          "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/7.png",
        img: "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/3.png",
        white_img:
          "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/11.png",
        gif: "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/new/tab3.png",
        text: "鉴赏",
      },
      {
        pagePath: a.default.PAGE_MINE_INDEX,
        selectImg:
          "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/8.png",
        img: "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/4.png",
        white_img:
          "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/12.png",
        gif: "https://industry.map.qq.com/cloud/miniapp/museum/san/tab-bar/new/tab4.png",
        text: "我的",
      },
    ],
    current: 0,
    count: 24,
    style: "",
  },
  methods: {
    switchTab: function (t) {
      var a = t.currentTarget.dataset,
        n = a.path,
        e = a.index,
        m = n;
      (getApp().globalData.tabBarParam.isFromTabBar = !0),
        this.setData({ isWhite: !1, selected: e }),
        wx.switchTab({ url: m });
    },
    checkBg: function (t) {
      this.setData({ isWhite: t });
    },
    play: function () {
      var t = this;
      n && (clearInterval(n), (n = null)),
        this.setData({ current: 0, style: "" }, function () {
          n = setInterval(function () {
            if (t.data.current === t.data.count)
              return clearInterval(n), void (n = null);
            t.setData({
              current: t.data.current + 1,
              style: t.getStyle(t.data.current + 1),
            });
          }, 1e3 / 24);
        });
    },
    getStyle: function (t) {
      return [
        "transform: translate3d(calc(76px * -1 * (".concat(t, " - 1)), 0, 0)"),
      ].join(";");
    },
  },
});
